package com.esri.core.tasks.na;

import com.esri.core.geometry.SpatialReference;
import com.esri.core.map.FeatureSet;
import com.esri.core.map.Graphic;
import java.util.ArrayList;
import java.util.List;

/* loaded from: classes.dex */
public abstract class NAResult {
    protected FeatureSet pointBarriers = null;
    protected FeatureSet polylineBarriers = null;
    protected FeatureSet polygonBarriers = null;
    protected List<NAMessage> messages = null;

    public FeatureSet getBarriers() {
        SpatialReference spatialReference;
        ArrayList arrayList = new ArrayList();
        FeatureSet featureSet = this.pointBarriers;
        if (featureSet != null) {
            spatialReference = featureSet.getSpatialReference();
            for (Graphic graphic : this.pointBarriers.getGraphics()) {
                arrayList.add(graphic);
            }
        } else {
            spatialReference = null;
        }
        FeatureSet featureSet2 = this.polylineBarriers;
        if (featureSet2 != null) {
            spatialReference = featureSet2.getSpatialReference();
            for (Graphic graphic2 : this.polylineBarriers.getGraphics()) {
                arrayList.add(graphic2);
            }
        }
        FeatureSet featureSet3 = this.polygonBarriers;
        if (featureSet3 != null) {
            spatialReference = featureSet3.getSpatialReference();
            for (Graphic graphic3 : this.polygonBarriers.getGraphics()) {
                arrayList.add(graphic3);
            }
        }
        if (arrayList.isEmpty()) {
            return null;
        }
        FeatureSet featureSet4 = new FeatureSet();
        Graphic[] graphicArr = new Graphic[arrayList.size()];
        arrayList.toArray(graphicArr);
        featureSet4.setGraphics(graphicArr);
        featureSet4.setSpatialReference(spatialReference);
        return featureSet4;
    }

    public FeatureSet getPointBarriers() {
        if (this.pointBarriers == null) {
            return null;
        }
        FeatureSet featureSet = new FeatureSet();
        featureSet.setGraphics(this.pointBarriers.getGraphics());
        featureSet.setSpatialReference(this.pointBarriers.getSpatialReference());
        return featureSet;
    }

    public FeatureSet getPolylineBarriers() {
        if (this.polylineBarriers == null) {
            return null;
        }
        FeatureSet featureSet = new FeatureSet();
        featureSet.setGraphics(this.polylineBarriers.getGraphics());
        featureSet.setSpatialReference(this.polylineBarriers.getSpatialReference());
        return featureSet;
    }

    public FeatureSet getPolygonBarriers() {
        if (this.polygonBarriers == null) {
            return null;
        }
        FeatureSet featureSet = new FeatureSet();
        featureSet.setGraphics(this.polygonBarriers.getGraphics());
        featureSet.setSpatialReference(this.polygonBarriers.getSpatialReference());
        return featureSet;
    }

    public List<NAMessage> getMessages() {
        if (this.messages == null) {
            return null;
        }
        return new ArrayList(this.messages);
    }

    public int hashCode() {
        List<NAMessage> list = this.messages;
        int hashCode = ((list == null ? 0 : list.hashCode()) + 31) * 31;
        FeatureSet featureSet = this.pointBarriers;
        int hashCode2 = (hashCode + (featureSet == null ? 0 : featureSet.hashCode())) * 31;
        FeatureSet featureSet2 = this.polygonBarriers;
        int hashCode3 = (hashCode2 + (featureSet2 == null ? 0 : featureSet2.hashCode())) * 31;
        FeatureSet featureSet3 = this.polylineBarriers;
        return hashCode3 + (featureSet3 != null ? featureSet3.hashCode() : 0);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            NAResult nAResult = (NAResult) obj;
            List<NAMessage> list = this.messages;
            if (list == null) {
                if (nAResult.messages != null) {
                    return false;
                }
            } else if (!list.equals(nAResult.messages)) {
                return false;
            }
            FeatureSet featureSet = this.pointBarriers;
            if (featureSet == null) {
                if (nAResult.pointBarriers != null) {
                    return false;
                }
            } else if (!featureSet.equals(nAResult.pointBarriers)) {
                return false;
            }
            FeatureSet featureSet2 = this.polygonBarriers;
            if (featureSet2 == null) {
                if (nAResult.polygonBarriers != null) {
                    return false;
                }
            } else if (!featureSet2.equals(nAResult.polygonBarriers)) {
                return false;
            }
            FeatureSet featureSet3 = this.polylineBarriers;
            if (featureSet3 == null) {
                if (nAResult.polylineBarriers != null) {
                    return false;
                }
            } else if (!featureSet3.equals(nAResult.polylineBarriers)) {
                return false;
            }
            return true;
        }
        return false;
    }
}
